package com.tchy.cloud.entity;

import javax.persistence.*;
import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * xmweilove
 * 课程
 */
@Entity
@Table(name = "a_course", schema = "", catalog = "")
public class ACourseEntity {
    private Long id;//主键,课程id course_id

    // private Long columns_id;//课程分类id---栏目
    private AColumnsEntity columnsEntity;

    private String name;//课程名称 name
    private String courseIntro;//课程简介 course_intro
    private String courseDesc;//课程描述 course_desc

    //    private Long consultantId;//咨询师id（课程所属导师）consultant_id
    private AConsultantEntity consultantEntity;


    private String backgrounp;//课程背景图 backgrounp
    private Float price;//课程单价 price
    private Integer effective;//是否有效 effective
    private Integer deleted;//是否删除 deleted
    private Date createTime;//创建时间 create_time
    private Integer personNum;//报名人数 person_num
    private String videoUrl;//视频地址  video_url

    //    private Long csid;//课程系列id   course_series_id
    private ACourseSeriesEntity courseSeriesEntity;
    private Integer homeShow;//首页显示 home_show

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "course_id")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "columns_id")
    public AColumnsEntity getColumnsEntity() {
        return columnsEntity;
    }

    public void setColumnsEntity(AColumnsEntity columnsEntity) {
        this.columnsEntity = columnsEntity;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "course_intro")
    public String getCourseIntro() {
        return courseIntro;
    }

    public void setCourseIntro(String courseIntro) {
        this.courseIntro = courseIntro;
    }

    @Basic
    @Column(name = "course_desc")
    public String getCourseDesc() {
        return courseDesc;
    }

    public void setCourseDesc(String courseDesc) {
        this.courseDesc = courseDesc;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "consultant_id")
    public AConsultantEntity getConsultantEntity() {
        return consultantEntity;
    }

    public void setConsultantEntity(AConsultantEntity consultantEntity) {
        this.consultantEntity = consultantEntity;
    }

    @Basic
    @Column(name = "backgrounp")
    public String getBackgrounp() {
        return backgrounp;
    }

    public void setBackgrounp(String backgrounp) {
        this.backgrounp = backgrounp;
    }

    @Basic
    @Column(name = "price")
    public Float getPrice() {
        return price;
    }

    public void setPrice(Float price) {
        this.price = price;
    }

    @Basic
    @Column(name = "effective")
    public Integer getEffective() {
        return effective;
    }

    public void setEffective(Integer effective) {
        this.effective = effective;
    }

    @Basic
    @Column(name = "deleted")
    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    @Basic
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "person_num")
    public Integer getPersonNum() {
        return personNum;
    }

    public void setPersonNum(Integer personNum) {
        this.personNum = personNum;
    }

    @Basic
    @Column(name = "video_url")
    public String getVideoUrl() {
        return videoUrl;
    }

    public void setVideoUrl(String videoUrl) {
        this.videoUrl = videoUrl;
    }


    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "course_series_id")
    public ACourseSeriesEntity getCourseSeriesEntity() {
        return courseSeriesEntity;
    }

    public void setCourseSeriesEntity(ACourseSeriesEntity courseSeriesEntity) {
        this.courseSeriesEntity = courseSeriesEntity;
    }

    @Basic
    @Column(name = "home_show")
    public Integer getHomeShow() {
        return homeShow;
    }

    public void setHomeShow(Integer homeShow) {
        this.homeShow = homeShow;
    }
}
